package require -exact qsys 12.1

# module properties
set_module_property NAME {niosii_system_export}
set_module_property DISPLAY_NAME {niosii_system_export_display}

# default module properties
set_module_property VERSION {1.0}
set_module_property GROUP {default group}
set_module_property DESCRIPTION {default description}
set_module_property AUTHOR {author}

# Instances and instance parameters
# (disabled instances are intentionally culled)
add_instance clk clock_source 13.0
set_instance_parameter_value clk clockFrequency {50000000.0}
set_instance_parameter_value clk clockFrequencyKnown {1}
set_instance_parameter_value clk resetSynchronousEdges {NONE}

add_instance nios altera_nios2_qsys 13.0
set_instance_parameter_value nios setting_showUnpublishedSettings {0}
set_instance_parameter_value nios setting_showInternalSettings {0}
set_instance_parameter_value nios setting_preciseSlaveAccessErrorException {0}
set_instance_parameter_value nios setting_preciseIllegalMemAccessException {0}
set_instance_parameter_value nios setting_preciseDivisionErrorException {0}
set_instance_parameter_value nios setting_performanceCounter {0}
set_instance_parameter_value nios setting_illegalMemAccessDetection {0}
set_instance_parameter_value nios setting_illegalInstructionsTrap {0}
set_instance_parameter_value nios setting_fullWaveformSignals {0}
set_instance_parameter_value nios setting_extraExceptionInfo {0}
set_instance_parameter_value nios setting_exportPCB {0}
set_instance_parameter_value nios setting_debugSimGen {0}
set_instance_parameter_value nios setting_clearXBitsLDNonBypass {1}
set_instance_parameter_value nios setting_bit31BypassDCache {1}
set_instance_parameter_value nios setting_bigEndian {0}
set_instance_parameter_value nios setting_export_large_RAMs {0}
set_instance_parameter_value nios setting_asic_enabled {0}
set_instance_parameter_value nios setting_asic_synopsys_translate_on_off {0}
set_instance_parameter_value nios setting_oci_export_jtag_signals {0}
set_instance_parameter_value nios setting_bhtIndexPcOnly {0}
set_instance_parameter_value nios setting_avalonDebugPortPresent {0}
set_instance_parameter_value nios setting_alwaysEncrypt {1}
set_instance_parameter_value nios setting_allowFullAddressRange {0}
set_instance_parameter_value nios setting_activateTrace {1}
set_instance_parameter_value nios setting_activateTestEndChecker {0}
set_instance_parameter_value nios setting_activateMonitors {1}
set_instance_parameter_value nios setting_activateModelChecker {0}
set_instance_parameter_value nios setting_HDLSimCachesCleared {1}
set_instance_parameter_value nios setting_HBreakTest {0}
set_instance_parameter_value nios muldiv_divider {0}
set_instance_parameter_value nios mpu_useLimit {0}
set_instance_parameter_value nios mpu_enabled {0}
set_instance_parameter_value nios mmu_enabled {0}
set_instance_parameter_value nios mmu_autoAssignTlbPtrSz {1}
set_instance_parameter_value nios manuallyAssignCpuID {1}
set_instance_parameter_value nios debug_triggerArming {1}
set_instance_parameter_value nios debug_embeddedPLL {1}
set_instance_parameter_value nios debug_debugReqSignals {0}
set_instance_parameter_value nios debug_assignJtagInstanceID {0}
set_instance_parameter_value nios dcache_omitDataMaster {0}
set_instance_parameter_value nios cpuReset {0}
set_instance_parameter_value nios is_hardcopy_compatible {0}
set_instance_parameter_value nios setting_shadowRegisterSets {0}
set_instance_parameter_value nios mpu_numOfInstRegion {8}
set_instance_parameter_value nios mpu_numOfDataRegion {8}
set_instance_parameter_value nios mmu_TLBMissExcOffset {0}
set_instance_parameter_value nios debug_jtagInstanceID {0}
set_instance_parameter_value nios resetOffset {0}
set_instance_parameter_value nios exceptionOffset {32}
set_instance_parameter_value nios cpuID {-2096029166}
set_instance_parameter_value nios cpuID_stored {-2096029166}
set_instance_parameter_value nios breakOffset {32}
set_instance_parameter_value nios userDefinedSettings {}
set_instance_parameter_value nios resetSlave {ram.s1}
set_instance_parameter_value nios mmu_TLBMissExcSlave {}
set_instance_parameter_value nios exceptionSlave {ram.s1}
set_instance_parameter_value nios breakSlave {ram.s1}
set_instance_parameter_value nios setting_perfCounterWidth {32}
set_instance_parameter_value nios setting_interruptControllerType {Internal}
set_instance_parameter_value nios setting_branchPredictionType {Automatic}
set_instance_parameter_value nios setting_bhtPtrSz {8}
set_instance_parameter_value nios muldiv_multiplierType {EmbeddedMulFast}
set_instance_parameter_value nios mpu_minInstRegionSize {12}
set_instance_parameter_value nios mpu_minDataRegionSize {12}
set_instance_parameter_value nios mmu_uitlbNumEntries {4}
set_instance_parameter_value nios mmu_udtlbNumEntries {6}
set_instance_parameter_value nios mmu_tlbPtrSz {7}
set_instance_parameter_value nios mmu_tlbNumWays {16}
set_instance_parameter_value nios mmu_processIDNumBits {8}
set_instance_parameter_value nios impl {Small}
set_instance_parameter_value nios icache_size {4096}
set_instance_parameter_value nios icache_tagramBlockType {Automatic}
set_instance_parameter_value nios icache_ramBlockType {Automatic}
set_instance_parameter_value nios icache_numTCIM {0}
set_instance_parameter_value nios icache_burstType {None}
set_instance_parameter_value nios dcache_bursts {false}
set_instance_parameter_value nios dcache_victim_buf_impl {ram}
set_instance_parameter_value nios debug_level {NoDebug}
set_instance_parameter_value nios debug_OCIOnchipTrace {_128}
set_instance_parameter_value nios dcache_size {2048}
set_instance_parameter_value nios dcache_tagramBlockType {Automatic}
set_instance_parameter_value nios dcache_ramBlockType {Automatic}
set_instance_parameter_value nios dcache_numTCDM {0}
set_instance_parameter_value nios dcache_lineSize {32}
set_instance_parameter_value nios setting_exportvectors {0}
set_instance_parameter_value nios setting_ecc_present {0}
set_instance_parameter_value nios regfile_ramBlockType {Automatic}
set_instance_parameter_value nios ocimem_ramBlockType {Automatic}
set_instance_parameter_value nios mmu_ramBlockType {Automatic}
set_instance_parameter_value nios bht_ramBlockType {Automatic}

add_instance ram altera_avalon_onchip_memory2 13.0.1
set_instance_parameter_value ram allowInSystemMemoryContentEditor {0}
set_instance_parameter_value ram blockType {AUTO}
set_instance_parameter_value ram dataWidth {32}
set_instance_parameter_value ram dualPort {1}
set_instance_parameter_value ram initMemContent {1}
set_instance_parameter_value ram initializationFileName {/home/alireza/Mywork/NOC/noc_sim/software/blink_led/test.hex}
set_instance_parameter_value ram instanceID {1001}
set_instance_parameter_value ram memorySize {16384.0}
set_instance_parameter_value ram readDuringWriteMode {DONT_CARE}
set_instance_parameter_value ram simAllowMRAMContentsFile {0}
set_instance_parameter_value ram simMemInitOnlyFilename {0}
set_instance_parameter_value ram singleClockOperation {0}
set_instance_parameter_value ram slave1Latency {1}
set_instance_parameter_value ram slave2Latency {1}
set_instance_parameter_value ram useNonDefaultInitFile {0}
set_instance_parameter_value ram useShallowMemBlocks {0}
set_instance_parameter_value ram writable {1}

add_instance nios_reset altera_reset_bridge 13.0
set_instance_parameter_value nios_reset ACTIVE_LOW_RESET {0}
set_instance_parameter_value nios_reset SYNCHRONOUS_EDGES {deassert}
set_instance_parameter_value nios_reset NUM_RESET_OUTPUTS {1}

add_instance led altera_avalon_pio 13.0.1
set_instance_parameter_value led bitClearingEdgeCapReg {0}
set_instance_parameter_value led bitModifyingOutReg {0}
set_instance_parameter_value led captureEdge {0}
set_instance_parameter_value led direction {Output}
set_instance_parameter_value led edgeType {RISING}
set_instance_parameter_value led generateIRQ {0}
set_instance_parameter_value led irqType {LEVEL}
set_instance_parameter_value led resetValue {0.0}
set_instance_parameter_value led simDoTestBenchWiring {0}
set_instance_parameter_value led simDrivenValue {0.0}
set_instance_parameter_value led width {1}

add_instance nic_interface nic_interface 1.0
set_instance_parameter_value nic_interface NIOS_RAM_WIDTH {13}
set_instance_parameter_value nic_interface S_ADDR_SIZE {2}

# connections and connection parameters
add_connection clk.clk nios.clk clock

add_connection clk.clk ram.clk1 clock

add_connection nios.instruction_master ram.s1 avalon
set_connection_parameter_value nios.instruction_master/ram.s1 arbitrationPriority {1}
set_connection_parameter_value nios.instruction_master/ram.s1 baseAddress {0x4000}
set_connection_parameter_value nios.instruction_master/ram.s1 defaultConnection {0}

add_connection nios.data_master ram.s1 avalon
set_connection_parameter_value nios.data_master/ram.s1 arbitrationPriority {1}
set_connection_parameter_value nios.data_master/ram.s1 baseAddress {0x4000}
set_connection_parameter_value nios.data_master/ram.s1 defaultConnection {0}

add_connection clk.clk ram.clk2 clock

add_connection clk.clk nios_reset.clk clock

add_connection nios_reset.out_reset nios.reset_n reset

add_connection clk.clk_reset ram.reset2 reset

add_connection nios_reset.out_reset ram.reset1 reset

add_connection clk.clk led.clk clock

add_connection nios_reset.out_reset led.reset reset

add_connection nios.data_master led.s1 avalon
set_connection_parameter_value nios.data_master/led.s1 arbitrationPriority {1}
set_connection_parameter_value nios.data_master/led.s1 baseAddress {0x8010}
set_connection_parameter_value nios.data_master/led.s1 defaultConnection {0}

add_connection clk.clk nic_interface.clock clock

add_connection clk.clk_reset nic_interface.reset reset

add_connection nic_interface.nios_m ram.s2 avalon
set_connection_parameter_value nic_interface.nios_m/ram.s2 arbitrationPriority {1}
set_connection_parameter_value nic_interface.nios_m/ram.s2 baseAddress {0x4000}
set_connection_parameter_value nic_interface.nios_m/ram.s2 defaultConnection {0}

add_connection nios.data_master nic_interface.nios_s avalon
set_connection_parameter_value nios.data_master/nic_interface.nios_s arbitrationPriority {1}
set_connection_parameter_value nios.data_master/nic_interface.nios_s baseAddress {0x8000}
set_connection_parameter_value nios.data_master/nic_interface.nios_s defaultConnection {0}

# exported interfaces
add_interface clk clock sink
set_interface_property clk EXPORT_OF clk.clk_in
add_interface reset reset sink
set_interface_property reset EXPORT_OF clk.clk_in_reset
add_interface nios_rst reset sink
set_interface_property nios_rst EXPORT_OF nios_reset.in_reset
add_interface led conduit end
set_interface_property led EXPORT_OF led.external_connection
add_interface nic_m conduit end
set_interface_property nic_m EXPORT_OF nic_interface.nic_m
add_interface nic_s conduit end
set_interface_property nic_s EXPORT_OF nic_interface.nic_s
